package zero.tech.games.mj.event;

import zero.tech.core.event.EventListener;
import zero.tech.core.event.EventType;
import zero.tech.games.logic.common.Room;
import zero.tech.games.logic.data.LogicEventType;
import zero.tech.games.logic.data.RoomStatus;
import zero.tech.games.mj.data.MjTimer;


/**
 * 取消解散房间时操作时间需要延后加上解散中用的时间
 * @author ludry
 *
 */
public class RoomDissolutionRuntimer implements EventListener{

	@Override
	public EventType netEventType() {
		return LogicEventType.ROOM_DISSOLUTION_RUNTIMER;
	}

	@Override
	public void notifyEvent(Object... objs) {
		Room room = (Room) objs[0];
		long pass=(long) objs[1];
		int room_status=room.getRoom_status();
		MjTimer mjTimer = (MjTimer) room.getTimer();
		if(room_status==RoomStatus.WAIT_NEXT_ROUND) {
			mjTimer.lastBeginToReadyTime+=pass;
		}
	}

	@Override
	public boolean asynchronous() {
		return false;
	}

}
